package com.ruoyi.jjm.mapper;

import java.util.List;
import com.ruoyi.jjm.domain.ClientUser;
import com.ruoyi.jjm.domain.TownStatistics;
import org.apache.ibatis.annotations.Param;

/**
 * 村民信息Mapper接口
 * 
 * @author tsr
 * @date 2020-07-15
 */
public interface ClientUserMapper 
{
    /**
     * 查询村民信息
     * 
     * @param id 村民信息ID
     * @return 村民信息
     */
    public ClientUser selectClientUserById(Long id);

    ClientUser selectByMasterNameAndIdCard(@Param("masterName")String masterName,@Param("masterIdentityCardNumber")String masterIdentityCardNumber);

    /**
     * 查询村民信息列表
     * 
     * @param clientUser 村民信息
     * @return 村民信息集合
     */
    public List<ClientUser> selectClientUserList(ClientUser clientUser);

    public List<ClientUser> selectClientUserByInput(@Param("input") String input,@Param("villageId") Long villageId);

    /**
     * 新增村民信息
     * 
     * @param clientUser 村民信息
     * @return 结果
     */
    public int insertClientUser(ClientUser clientUser);

    /**
     * 修改村民信息
     * 
     * @param clientUser 村民信息
     * @return 结果
     */
    public int updateClientUser(ClientUser clientUser);

    /**
     * 删除村民信息
     * 
     * @param id 村民信息ID
     * @return 结果
     */
    public int deleteClientUserById(Long id);

    /**
     * 批量删除村民信息
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteClientUserByIds(String[] ids);

    /**
     *
     * @param users
     * @return
     */
    public int batchInsertClientUsers(@Param("users") List<ClientUser> users);

    public int countVillageAlarm(long villageId);

    public int  countVillageNote(long villageId);

    public List<ClientUser> selectClientUserByNote(long villageId);

    public List<ClientUser> selectClientUserByAlarm(long villageId);

    public List<ClientUser> selectXiangUnistallAlarmList(Long xiangId);

    public List<ClientUser> selectXiangNoNoteList(Long xiangId);

    /**
     * 乡的未装报警器
     * @param
     * @return
     */
    int selectXiangUninstallAlarmCount(Long xiangId);

    int selectXiangNoNoteCount(Long xiangId);

    int countGridById(Long id);

    TownStatistics selectXiangStatisitcsByXiangId(Long xiangId);

    /**
     * 统计包联人的包联户数
     * @param baolianrenId
     * @return
     */
    public Long countBaolianHouseNum(Long baolianrenId);

    /**
     * 统计包联人的包联人数
     * @param baolianrenId
     * @return
     */
    public Long sumBaolianPersonNum(Long baolianrenId);


    public List<ClientUser> selectClientUserOrderList(Long villageId);
    public Long countVillagePopulation(Long id);

    /**
     * 统计乡的村包联户数
     * @param townId
     * @return
     */
    Long countBaolianHouseNumByTown(Long townId);
    /**
     * 统计乡的村包联人数
     * @param townId
     * @return
     */
    Long sumBaolianPersonNumByTown(Long townId);
}
